const { createHash } = require("crypto");
const {
  developerRoleID,
  masterRoleID,
  adminRoleID,
  rootID,
  masterID
} = require("../generator");

module.exports = {
  up: (queryInterface, Sequelize) => {
    return queryInterface.bulkInsert(
      "t_role",
      [
        {
          id: developerRoleID,
          role_name: "开发者",
          status: "001",
          type: "000",
          remark: "开发者是各个部门普通用户",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: masterID,
          role_name: "审核员",
          status: "001",
          type: "001",
          remark: "审核员是各个部门对包的一级管理人员",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        },
        {
          id: adminRoleID,
          role_name: "管理员",
          type: "100",
          remark: "管理员是系统的管理者",
          create_user_id: rootID,
          modify_user_id: rootID,
          create_time: new Date(),
          modify_time: new Date()
        }
      ],
      {}
    );
  },

  down: (queryInterface, Sequelize) => {
    return queryInterface.bulkDelete("t_role", null, {});
  }
};
